home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
- #
- # $Id: start 1.7 1997/05/22 13:52:55 des Exp $
- #
- # Copyright (c) 1991-1997, Inso Corporation.
- # All Rights Reserved.
- #
- #
- # Usage: start
- #
- # This script starts the dwhttpd daemon.
- #
- #####################################################################
- set machine = `uname -s`
- set env_set = 0
- switch ("$machine")
- case "HP*":
- set LIB_PATH = SHLIB_PATH
- if ( $?SHLIB_PATH ) then
- set env_set = 1
- endif
- breaksw
-
- case "SunOS*":
- case "IRIX*":
- set LIB_PATH = LD_LIBRARY_PATH
- if ( $?LD_LIBRARY_PATH ) then
- set env_set = 1
- endif
- breaksw
-
- case "AIX*":
- set LIB_PATH = LIBPATH
- if ( $?LIBPATH ) then
- set env_set = 1
- endif
- breaksw
-
- default :
- set LIB_PATH = LD_LIBRARY_PATH
- if ( $?LD_LIBRARY_PATH ) then
- set env_set = 1
- endif
- breaksw
-
- endsw
-
-
- if( $env_set == 1 ) then
- setenv $LIB_PATH ../lib:`eval echo \$$LIB_PATH`
- else
- setenv $LIB_PATH ../lib
- endif
-
- if ($#argv < 1) then
- if ($?DWEB_DATA_DIR) then
- set data_dir=$DWEB_DATA_DIR
- set got_data_dir_by=env
- else
- set data_dir=../../data
- set got_data_dir_by=default
- endif
- else
- set data_dir=$1
- set got_data_dir_by=arg
- endif
-
- if (! -e $data_dir) then
- echo "DATA directory '$data_dir' not does not exist\!"
-
- switch ($got_data_dir_by)
-
- case default:
- echo "You can either supply a DATA directory argument to this script"
- echo "or you can set an environment variable called DWEB_DATA_DIR to"
- echo "designate a path to a valid DATA directory."
- breaksw
-
- case arg:
- echo "The DATA directory argument you supplied does not point at a"
- echo "valid DATA directory. Please check the path and try again."
- echo "Optionally, you can set a variable called DWEB_DATA_DIR to "
- echo "designate a path to a valid DATA directory."
- breaksw
-
- case env:
- echo "The DWEB_DATA_DIR enviroment variable does not point at a valid"
- echo "DATA directory. Please check the path and try again."
- breaksw
-
- endsw
- exit
- else
- if ($data_dir == '../../data') then
- set data_dir=""
- endif
- endif
-
- ./dwhttpd $data_dir
-